<?php

namespace App\Models;

use Framework\BaseModel;
use Framework\ModelEncryptionTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
 * App\Models\_EmptyModel
 *
 * @method static \Illuminate\Database\Eloquent\Builder|_EmptyModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|_EmptyModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|_EmptyModel query()
 * @mixin \Eloquent
 * @property int $user_id
 * @property string $nickname 昵称
 * @property int $sex 性别(0-男,1-女)
 * @property string|null $birthday 生日
 * @property string|null $signature 签名
 * @property string|null $avatar 头像
 * @property int|null $province_id 省编号
 * @property string|null $province 省
 * @property int|null $city_id 市编号
 * @property string|null $city 市
 * @property int|null $county_id 县编号
 * @property string|null $county 县
 * @property string|null $address 详细地址
 * @property string|null qiniu_uid 七牛uid
 * @property string|null $im_user_code im编号
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereAvatar($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereBirthday($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereCityId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereCounty($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereCountyId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereImUserCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereProvinceId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereSex($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereSignature($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereUserId($value)
 * @property int $id
 * @method static \Illuminate\Database\Eloquent\Builder|UserModel whereId($value)
 */
class UserModel extends BaseModel
{
    use ModelEncryptionTrait;
    use HasFactory;

    protected $encryptable = ['phone'];
    protected $table = 'user';
    protected $fillable = ['qiniu_uid','qiniu_nickname'];


    /**
     * 预约直播
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
//    public function subscribeCourse()
//    {
//        return $this->belongsToMany(Live::class,'live_appointments')
//            ->withTimestamps()
//            ->orderBy('live_appointments.created_at','desc');
//    }
//
//    public function userLoveInfo()
//    {
//        return $this->hasOne(UserLoveInfoModel::class, 'user_id');
//    }

}
